
require 'xm/platform'
group(:component) do
  conf = XM::Platform.root.join("comps/kairosdb/kairosdb/conf/kairosdb_with_4_12.properties").to_s
  dumpfile = XM::Platform.root.join("comps/kairosdb/kairosdb/dump")
  tmpfile = XM::Platform.root.join("comps/kairosdb/kairosdb/temp")
    java(:kairosdb, "comps/kairosdb/kairosdb",
         :order => 76,
         :stdout => "../logs/kairosdb.log",
         :classpath => %W[conf lib/*.jar],
	 :debug => 2017,
         :java_options => %W{-Xms384M -Xmx384M -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=#{dumpfile} -Djava.io.tmpdir=#{tmpfile} },
         :start => {:main => "org.kairosdb.core.Main",:arguments => %W{-c run -p #{conf}}},
         :started => {:heartbeat => 9200,:max => 10.minutes},
         :stopped => {:heartbeat => 9200},
         :mandatory => true,
         :stop => :kill
	)
end